#define LOG_TAG "samplelytest"
#include <vendor/lyzr/hardware/lytest/1.0/ILyTest.h>
#include <vendor/lyzr/hardware/lytest/1.0/ILyTestCallback.h>
#include <log/log.h>

using ::vendor::lyzr::hardware::lytest::V1_0::ILyTest;
using ::vendor::lyzr::hardware::lytest::V1_0::ILyTestCallback;
using ::android::hardware::hidl_vec;
using ::android::sp;
using ::android::hardware::Return;
using ::android::hardware::Void;

class LyTestCallback: public ILyTestCallback
{
public:
    Return<void> onNotify(int32_t event)
    {
        ALOGD("onNotify: value = %d", event);
        return Void();
    }
};

int main()
{
    sp<ILyTest> service = ILyTest::getService();
    if( service == nullptr )
    {
        ALOGE("Can't find ILyTest service...");
        return -1;
    }
    ALOGD("ILyTest test");

    sp<LyTestCallback> testCallback = new LyTestCallback();
    service->setCallback(testCallback);
    service->test();

    ::sleep(10);

    return 0;
}
